<?php
require "../clases/conexion.php";
require "../clases/usuarios.php";
require "../clases/template.php";
switch ($_POST['flag']) {
    case "login":
		$user = new usuarios($_POST['user'],$_POST['pass']);
		$user ->getUser();
		if(isset($user->errorReturn)){
			echo $user->errorReturn;
		}else{
			$templateHome = new template("../templates/createCard.php");
			$templateHome->title = "Cear Carta";
			echo $templateHome;
		}
        break;
    case "logout":
        echo "i es igual a 1";
        break;
    case "new":
        echo "i es igual a 2";
        break;
}
?>